<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<link rel="stylesheet" type="text/css" href="style.css" />
		<title>项目管理系统</title>
		<script src="./jQuery/jquery-1.8.0.js"></script>
		<script src="util.js"></script>
		<script src="query.js"></script>
		<script src="insert.js"></script>
	</head>
	<body onload='onLoad()'>
		<div id="userInfo">
		</div>
		<div id='timeline'>
		</div>
		<hr noshade />
		<div id='filter'>
			显示前<input id='day' maxlength='4' />天以内的时间线，结束日期<input id='date' readonly="true" onclick="fPopCalendar(date,date);return false"/>
			<button id='commit' class="button updateBtn">显示时间线</button>
		</div>
	</body>
	
	<script type="text/javascript">
		$('#userInfo').load('loadUserInfo.php', function() {
			if(getCookie('login') && getCookie('login') == 'true') {
				$('a#user').text(getCookie('nickname'));
				$('td#td2 a').attr('href', 'index.php');
				$('td#td2 a').html('返回');
			} else {
				location.href = 'login.html';
			}
		});
		$('#commit').click(function() {
			showTimeline($('#day').attr('value'), $('#date').attr('value'));
		});
		
		function showTimeline(day, endDate) {
			day = day || 0;
			endDate = endDate || 0;
			if(day == 0 || day == '' || day == 'undefined') day = 60;
			if(endDate == 0 || endDate == '' || day == 'undefined') endDate = getCurrDate();
			
			$('#timeline').load('loadTimeline.php?day=' + day + '&endDate=' + endDate, function() {
				$('#day').attr('value', day);
				$('#date').attr('value', endDate);
			});
		}
		function onLoad() {
			//$('#day').attr('value', 60);
			//$('#date').attr('value', getCurrDate());
			showTimeline();
		}
	</script>
	<script src="./jQuery/canvas-nest.min.js"></script>
</html>